#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e6+5;
ll T,n,a[N];
int main(){
    freopen("color.in","r",stdin);
    freopen("color.out","w",stdout);
    cin>>T;
    while(T--){
        cin>>n;
        for(ll i=1;i<=n;i++){
            cin>>a[i];
        }
        if(n==1){
            cout<<a[n];
            return 0;
        }
    }
    return 0;
}
